<script setup>
import { loginByAdminApi } from '@/api/auth/user'
import router from '@/router'
import { useUserStore } from '@/stores/user'
import { ElMessage } from 'element-plus'
import { ref, onMounted, onUnmounted } from 'vue'
import { User, Lock } from '@element-plus/icons-vue'

// 导入图标
import wxIcon from '@/assets/img/wx.png'

/**
 * 登入表单数据
 */
const loginForm = ref({
  userAccount: "",
  userPassword: "",
})

const loginFormRef = ref(null)
const loading = ref(false)
const activeServiceIndex = ref(0)
const animationInterval = ref(null)
const loginType = ref('password')

// 扩展的核心服务展示数据
const coreServices = ref([
  {
    name: '统一身份认证',
    icon: '🔐',
    color: '#00f2fe',
    desc: '多租户RBAC权限控制',
    features: ['单点登录', '多因子认证', '会话管理', '权限审计', '组织架构']
  },
  {
    name: '智能供应链',
    icon: '🤖',
    color: '#4facfe',
    desc: 'AI决策与预测分析',
    features: ['需求预测', '智能路由', '风险预警', '库存优化', '供应商协同']
  },
  {
    name: '全渠道订单',
    icon: '📦',
    color: '#43e97b',
    desc: 'B2B/B2C一体化处理',
    features: ['订单拆分', '状态跟踪', '异常处理', '多渠道同步', '退换货管理']
  },
  {
    name: '智慧仓储',
    icon: '🏭',
    color: '#fa709a',
    desc: '多级库存智能管理',
    features: ['库存优化', '批次管理', '成本核算', '智能盘点', '库位规划']
  },
  {
    name: '金融科技',
    icon: '💳',
    color: '#ffb300',
    desc: '供应链金融服务',
    features: ['应收账款融资', '信用评估', '风险控制', '资金结算', '电子发票']
  },
  {
    name: '实时监控',
    icon: '📊',
    color: '#a8edea',
    desc: '全链路业务看板',
    features: ['实时数据', '预警监控', '性能分析', '智能报表', 'KPI追踪']
  }
])

// 实时业务数据指标
const businessMetrics = ref([
  { label: '供应商协同', value: '8,560+', unit: '家', trend: '+12%' },
  { label: '日订单处理', value: '23.4K', unit: '单', trend: '+8%' },
  { label: '库存SKU', value: '156K', unit: '个', trend: '+15%' },
  { label: '月交易额', value: '2.8B', unit: '元', trend: '+23%' },
  { label: '系统可用性', value: '99.99', unit: '%', trend: '+0.01%' },
  { label: '客户满意度', value: '98.5', unit: '%', trend: '+2.1%' }
])

// 平台特色功能展示
const platformFeatures = ref([
  {
    title: 'AI智能分析',
    desc: '基于机器学习的智能决策',
    icon: '🧠',
    color: '#00f2fe'
  },
  {
    title: '实时数据大屏',
    desc: '全链路业务数据可视化',
    icon: '📈',
    color: '#4facfe'
  },
  {
    title: '移动端支持',
    desc: '多终端无缝协同办公',
    icon: '📱',
    color: '#43e97b'
  },
  {
    title: '开放API',
    desc: '完善的系统集成能力',
    icon: '🔌',
    color: '#fa709a'
  }
])

/**
 * 登入表单验证规则
 */
const loginFormRule = ref({
  userAccount: [
    { required: true, message: "请输入用户名", trigger: "blur" },
    { min: 2, max: 10, message: "用户名长度为2到10位", trigger: "blur" },
  ],
  userPassword: [
    { required: true, message: "请输入密码", trigger: "blur" },
    { min: 2, max: 20, message: "密码长度为2到20位", trigger: "blur" },
  ],
})

/**
 * 重置表单方法
 */
const resetLoginForm = () => {
  loginFormRef.value.resetFields()
}

/**
 * 登入方法
 */
const login = async () => {
  if (!loginFormRef.value) return

  // 微信登录功能提示
  if (loginType.value === 'wechat') {
    ElMessage({
      message: "微信登录功能开发中...",
      type: "info",
    })
    return
  }

  // 表单验证
  const valid = await loginFormRef.value.validate()
  if (!valid) {
    ElMessage({
      message: "请完善登录信息",
      type: "warning",
    })
    return
  }

  loading.value = true
  try {
    const res = await loginByAdminApi(loginForm.value)
    useUserStore().setUserInfo(res.data)
    ElMessage({
      message: "登录成功，正在进入系统...",
      type: "success",
    })
    setTimeout(() => {
      router.push('/layout')
    }, 1000)
  } catch (error) {
    console.log('登录错误:', error)
    ElMessage({
      message: error?.response?.data?.message || "登录失败，请检查账号密码",
      type: "error",
    })
  } finally {
    loading.value = false
  }
}

/**
 * 切换登录方式
 */
const switchLoginType = (type) => {
  loginType.value = type
  if (type === 'password') {
    resetLoginForm()
  }
}

/**
 * 启动服务展示轮播动画
 */
const startServiceAnimation = () => {
  animationInterval.value = setInterval(() => {
    activeServiceIndex.value = (activeServiceIndex.value + 1) % coreServices.value.length
  }, 4000)
}

/**
 * 键盘回车登录事件处理
 */
const handleKeyPress = (event) => {
  if (event.key === 'Enter' && !loading.value && loginType.value === 'password') {
    login()
  }
}

// 组件挂载时的事件监听
onMounted(() => {
  document.addEventListener('keypress', handleKeyPress)
  startServiceAnimation()
})

// 组件卸载时的事件清理
onUnmounted(() => {
  document.removeEventListener('keypress', handleKeyPress)
  if (animationInterval.value) {
    clearInterval(animationInterval.value)
  }
})
</script>

<template>
  <div class="login-container">
    <!-- 科技感背景 -->
    <div class="tech-background">
      <div class="bg-pattern"></div>
      <div class="light-effects">
        <div class="light light-1"></div>
        <div class="light light-2"></div>
        <div class="light light-3"></div>
      </div>
    </div>

    <!-- 主内容区域 -->
    <div class="single-page-content">
      <!-- 左侧品牌与功能展示 -->
      <div class="brand-display">
        <!-- 品牌标识区 -->
        <div class="brand-section">
          <div class="logo-area">
            <div class="logo-icon">🚀</div>
          </div>
          <div class="brand-text">
            <h1 class="main-title">籍祥供应链云平台</h1>
            <div class="subtitle">用户管理控制台</div>
            <div class="tag-line">智能管理 · 数据驱动 · 安全可控</div>
          </div>
        </div>

        <!-- 核心服务展示 -->
        <div class="services-showcase">
          <div class="showcase-header">
            <h3>平台核心能力</h3>
            <div class="carousel-indicators">
              <span
                v-for="(_, index) in coreServices"
                :key="index"
                class="indicator"
                :class="{ active: index === activeServiceIndex }"
              ></span>
            </div>
          </div>
          <div class="services-content">
            <div
              v-for="(service, index) in coreServices"
              :key="service.name"
              class="service-item"
              :class="{ active: index === activeServiceIndex }"
            >
              <div class="service-icon" :style="{ color: service.color }">
                {{ service.icon }}
              </div>
              <div class="service-details">
                <h4 :style="{ color: service.color }">{{ service.name }}</h4>
                <p>{{ service.desc }}</p>
                <div class="feature-tags">
                  <span v-for="feature in service.features" :key="feature" class="tag">
                    {{ feature }}
                  </span>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 业务数据指标 -->
        <div class="metrics-grid">
          <div v-for="metric in businessMetrics" :key="metric.label" class="metric-card">
            <div class="metric-value">
              {{ metric.value }}
              <span class="metric-unit">{{ metric.unit }}</span>
            </div>
            <div class="metric-label">{{ metric.label }}</div>
            <div class="metric-trend" :class="{ positive: metric.trend.includes('+') }">
              {{ metric.trend }}
            </div>
          </div>
        </div>

        <!-- 系统优势 -->
        <div class="advantages-section">
          <h3>系统特色优势</h3>
          <div class="advantages-grid">
            <div v-for="advantage in platformFeatures" :key="advantage.title" class="advantage-item">
              <div class="advantage-icon" :style="{ color: advantage.color }">
                {{ advantage.icon }}
              </div>
              <div class="advantage-content">
                <div class="advantage-title">{{ advantage.title }}</div>
                <div class="advantage-desc">{{ advantage.desc }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 右侧登录面板 -->
      <div class="login-panel-section">
        <div class="sleek-login-panel">
          <div class="panel-header">
            <div class="welcome-section">
              <h2>欢迎登录</h2>
              <p>籍祥供应链用户管理系统</p>
            </div>
          </div>

          <!-- 登录方式切换 -->
          <div class="login-type-selector">
            <button
              class="type-btn"
              :class="{ active: loginType === 'password' }"
              @click="switchLoginType('password')"
            >
              <span class="btn-icon">🔑</span>
              <span>密码登录</span>
            </button>
            <button
              class="type-btn"
              :class="{ active: loginType === 'wechat' }"
              @click="switchLoginType('wechat')"
            >
              <span class="btn-icon">
                <img :src="wxIcon" alt="微信" class="wx-icon" />
              </span>
              <span>微信登录</span>
            </button>
          </div>

          <!-- 密码登录表单 -->
          <div v-if="loginType === 'password'" class="login-form-section">
            <el-form
              ref="loginFormRef"
              :model="loginForm"
              :rules="loginFormRule"
              size="large"
            >
              <el-form-item prop="userAccount">
                <el-input
                  v-model="loginForm.userAccount"
                  placeholder="请输入用户名/工号"
                  :prefix-icon="User"
                  clearable
                />
              </el-form-item>

              <el-form-item prop="userPassword">
                <el-input
                  v-model="loginForm.userPassword"
                  placeholder="请输入登录密码"
                  :prefix-icon="Lock"
                  type="password"
                  show-password
                  clearable
                />
              </el-form-item>

              <el-form-item>
                <el-button
                  type="primary"
                  :loading="loading"
                  @click="login"
                  class="sleek-login-btn"
                >
                  <span v-if="!loading">
                    <span class="btn-start-icon">→</span>
                    登录管理系统
                  </span>
                  <span v-else>登录中...</span>
                </el-button>
              </el-form-item>
            </el-form>
          </div>

          <!-- 微信登录区域 -->
          <div v-else class="wechat-login-section">
            <div class="wechat-main-content">
              <div class="qrcode-display">
                <div class="qrcode-box">
                  <div class="scan-animation-line"></div>
                  <div class="wx-icon-wrapper">
                    <img :src="wxIcon" alt="微信" class="wx-qr-logo" />
                  </div>
                </div>
              </div>
              <div class="wechat-instruction">
                <h4>微信扫码登录</h4>
                <p>使用微信扫一扫二维码</p>
                <p>快速安全登录系统</p>
              </div>
            </div>
          </div>

          <!-- 安全提示 -->
          <div class="security-notice">
            <div class="notice-item">
              <span class="notice-icon">🔒</span>
              <span>SSL加密</span>
            </div>
            <div class="notice-item">
              <span class="notice-icon">🛡️</span>
              <span>企业级防护</span>
            </div>
            <div class="notice-item">
              <span class="notice-icon">⚡</span>
              <span>高速稳定</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 底部信息 -->
    <div class="sleek-footer">
      <div class="footer-content">
        <div class="copyright">© 2024 籍祥供应链云平台 - 用户管理系统 v3.0</div>
        <div class="contact">技术支持专线: 400-888-8888</div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
/* ===== 登录容器主样式 - 科技深色风格 ===== */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #0c0e17 0%, #14182c 50%, #1e2746 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== 科技背景设计 ===== */
.tech-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;

  .bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
      radial-gradient(circle at 20% 80%, rgba(0, 242, 254, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(79, 172, 254, 0.05) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(67, 233, 123, 0.08) 0%, transparent 50%);
  }

  .light-effects {
    .light {
      position: absolute;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, transparent 70%);

      &.light-1 {
        width: 200px;
        height: 200px;
        top: -50px;
        left: -50px;
        animation: pulseLight 8s infinite ease-in-out;
      }

      &.light-2 {
        width: 150px;
        height: 150px;
        top: 60%;
        right: -30px;
        animation: pulseLight 12s infinite ease-in-out reverse;
      }

      &.light-3 {
        width: 100px;
        height: 100px;
        bottom: -20px;
        left: 30%;
        animation: pulseLight 10s infinite ease-in-out;
      }
    }
  }
}

/* ===== 主内容区域布局 ===== */
.single-page-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 50px;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 30px 40px;
  position: relative;
  z-index: 2;
  height: calc(100vh - 80px);
  overflow: hidden;
}

/* ===== 左侧品牌展示区域 ===== */
.brand-display {
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow: hidden;

  .brand-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding: 10px 0;

    .logo-area {
      .logo-icon {
        font-size: 40px;
        background: linear-gradient(135deg, #00f2fe, #4facfe, #43e97b);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
      }
    }

    .brand-text {
      .main-title {
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 6px;
        color: #e2e8f0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        line-height: 1.2;
      }

      .subtitle {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 6px;
        font-weight: 600;
      }

      .tag-line {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.7);
        font-weight: 500;
      }
    }
  }
}

/* ===== 核心服务展示区域 - 科技风格 ===== */
.services-showcase {
  background: rgba(30, 39, 70, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 16px;
  padding: 16px;
  min-height: 140px;
  flex: 0 0 auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);

  .showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;

    h3 {
      font-size: 16px;
      color: #e2e8f0;
      margin: 0;
      font-weight: 600;
    }

    .carousel-indicators {
      display: flex;
      gap: 5px;

      .indicator {
        width: 5px;
        height: 5px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 50%;
        transition: all 0.3s ease;

        &.active {
          background: #00f2fe;
          transform: scale(1.2);
        }
      }
    }
  }

  .services-content {
    min-height: 100px;

    .service-item {
      display: none;

      &.active {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        animation: slideIn 0.5s ease-out;
      }

      .service-icon {
        font-size: 24px;
        flex-shrink: 0;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
      }

      .service-details {
        flex: 1;

        h4 {
          font-size: 15px;
          font-weight: 600;
          margin-bottom: 4px;
          color: #e2e8f0;
        }

        p {
          color: rgba(255, 255, 255, 0.8);
          font-size: 12px;
          margin-bottom: 6px;
          line-height: 1.3;
        }

        .feature-tags {
          display: flex;
          flex-wrap: wrap;
          gap: 4px;

          .tag {
            background: rgba(0, 242, 254, 0.15);
            color: #00f2fe;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            border: 1px solid rgba(0, 242, 254, 0.3);
            white-space: nowrap;
          }
        }
      }
    }
  }
}

/* ===== 业务数据指标网格 ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  min-height: 90px;

  .metric-card {
    background: rgba(30, 39, 70, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);

    .metric-value {
      font-size: 18px;
      font-weight: 700;
      color: #4facfe;
      margin-bottom: 4px;

      .metric-unit {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        margin-left: 2px;
      }
    }

    .metric-label {
      font-size: 10px;
      color: rgba(255, 255, 255, 0.7);
      margin-bottom: 2px;
    }

    .metric-trend {
      font-size: 9px;
      font-weight: 600;
      color: #43e97b;

      &.positive {
        color: #43e97b;
      }
    }
  }
}

/* ===== 系统优势区域 ===== */
.advantages-section {
  min-height: 80px;

  h3 {
    font-size: 16px;
    color: #e2e8f0;
    margin-bottom: 10px;
    font-weight: 600;
  }

  .advantages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;

    .advantage-item {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(30, 39, 70, 0.4);
      padding: 10px;
      border-radius: 8px;
      border: 1px solid rgba(0, 242, 254, 0.15);
      transition: all 0.3s ease;

      &:hover {
        background: rgba(30, 39, 70, 0.6);
        transform: translateY(-1px);
      }

      .advantage-icon {
        font-size: 14px;
        flex-shrink: 0;
      }

      .advantage-content {
        .advantage-title {
          font-size: 12px;
          font-weight: 600;
          color: #e2e8f0;
          margin-bottom: 2px;
        }

        .advantage-desc {
          font-size: 10px;
          color: rgba(255, 255, 255, 0.7);
          line-height: 1.2;
        }
      }
    }
  }
}

/* ===== 右侧登录面板区域 - 科技风格 ===== */
.login-panel-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;

  .sleek-login-panel {
    background: rgba(30, 39, 70, 0.9);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 242, 254, 0.4);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    height: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);

    .panel-header {
      margin-bottom: 25px;

      .welcome-section {
        text-align: center;

        h2 {
          font-size: 24px;
          color: #e2e8f0;
          margin-bottom: 6px;
          font-weight: 700;
        }

        p {
          color: #8a9ba8;
          font-size: 14px;
          margin: 0;
        }
      }
    }

    .login-type-selector {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 25px;

      .type-btn {
        background: rgba(20, 24, 44, 0.8);
        border: 1px solid #2d3746;
        border-radius: 10px;
        padding: 12px;
        color: #8a9ba8;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 44px;

        &.active {
          background: linear-gradient(135deg, rgba(0, 242, 254, 0.2) 0%, rgba(79, 172, 254, 0.1) 100%);
          border-color: #00f2fe;
          color: #00f2fe;
          box-shadow: 0 4px 12px rgba(0, 242, 254, 0.25);
        }

        &:hover {
          border-color: #00f2fe;
          transform: translateY(-1px);
        }

        .btn-icon {
          font-size: 16px;
          display: flex;
          align-items: center;
          justify-content: center;

          .wx-icon {
            width: 18px;
            height: 18px;
            object-fit: contain;
          }
        }
      }
    }
  }
}

/* ===== 密码登录表单区域 - 科技风格 ===== */
.login-form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-height: 160px;

  :deep(.el-form) {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  :deep(.el-form-item) {
    margin-bottom: 0;
  }

  :deep(.el-input) {
    .el-input__wrapper {
      background: rgba(20, 24, 44, 0.8);
      border: 1px solid #2d3746;
      border-radius: 10px;
      box-shadow: none;
      transition: all 0.3s ease;
      height: 46px;
      padding: 0 14px;

      &:hover {
        border-color: #00f2fe;
        box-shadow: 0 2px 6px rgba(0, 242, 254, 0.1);
      }

      &.is-focus {
        border-color: #00f2fe;
        box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.2);
      }
    }

    .el-input__inner {
      color: #e2e8f0;
      background: transparent;
      font-size: 14px;
      height: 100%;
      line-height: 46px;

      &::placeholder {
        color: #5c6b7e;
        font-size: 13px;
      }
    }

    .el-input__prefix-inner {
      color: #00f2fe;
      font-size: 15px;
      margin-right: 6px;
    }
  }

  .sleek-login-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    border: none;
    border-radius: 10px;
    color: #0c0e17;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
    }

    &:active {
      transform: translateY(0);
    }

    .btn-start-icon {
      margin-right: 6px;
      font-weight: 700;
    }
  }
}

/* ===== 微信登录区域 - 科技风格 ===== */
.wechat-login-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;

  .wechat-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
    min-height: 0;

    .qrcode-display {
      .qrcode-box {
        position: relative;
        background: rgba(20, 24, 44, 0.9);
        border: 2px solid #2d3746;
        border-radius: 16px;
        width: 160px;
        height: 160px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);

        .scan-animation-line {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 3px;
          background: linear-gradient(90deg, transparent, #43e97b, transparent);
          animation: qrScan 2.5s infinite linear;
          z-index: 1;
        }

        .wx-icon-wrapper {
          .wx-qr-logo {
            width: 70px;
            height: 70px;
            object-fit: contain;
          }
        }
      }
    }

    .wechat-instruction {
      text-align: center;

      h4 {
        color: #e2e8f0;
        margin-bottom: 10px;
        font-size: 18px;
        font-weight: 600;
      }

      p {
        color: #8a9ba8;
        font-size: 14px;
        margin: 4px 0;
        line-height: 1.4;
      }
    }
  }
}

/* ===== 安全提示区域 - 科技风格 ===== */
.security-notice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #2d3746;

  .notice-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #00f2fe;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;

    .notice-icon {
      font-size: 14px;
    }
  }
}

/* ===== 底部信息 ===== */
.sleek-footer {
  padding: 15px 0;
  text-align: center;
  position: relative;
  z-index: 2;

  .footer-content {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;

    .copyright {
      margin-bottom: 3px;
    }

    .contact {
      color: rgba(255, 255, 255, 0.6);
      font-size: 11px;
    }
  }
}

/* ===== 动画定义 ===== */
@keyframes pulseLight {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.05);
  }
}

@keyframes qrScan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(160px);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1400px) {
  .single-page-content {
    grid-template-columns: 1fr;
    gap: 35px;
    max-width: 900px;
    padding: 30px 35px;
    height: auto;
    overflow: auto;
  }

  .brand-display {
    overflow: visible;
  }

  .login-panel-section {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;

    .sleek-login-panel {
      height: 500px;
    }
  }
}

@media (max-width: 768px) {
  .login-container {
    overflow: auto;
  }

  .single-page-content {
    padding: 25px 18px;
    gap: 25px;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .brand-display {
    width: 100%;

    .brand-section {
      flex-direction: column;
      text-align: center;
      gap: 12px;
    }

    .metrics-grid {
      grid-template-columns: 1fr;
    }

    .advantages-grid {
      grid-template-columns: 1fr;
    }
  }

  .login-panel-section {
    width: 100%;

    .sleek-login-panel {
      padding: 25px 20px;
      height: 480px;
      max-width: 100%;
    }
  }

  .security-notice {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wechat-login-section {
    .wechat-main-content {
      .qrcode-display .qrcode-box {
        width: 140px;
        height: 140px;

        .wx-icon-wrapper .wx-qr-logo {
          width: 60px;
          height: 60px;
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .single-page-content {
    padding: 20px 15px;
  }

  .brand-display {
    .brand-text .main-title {
      font-size: 22px;
    }
  }

  .login-type-selector {
    grid-template-columns: 1fr;
  }

  .sleek-login-panel {
    padding: 20px 18px;
  }

  .wechat-login-section .wechat-main-content {
    .qrcode-display .qrcode-box {
      width: 130px;
      height: 130px;

      .wx-icon-wrapper .wx-qr-logo {
        width: 55px;
        height: 55px;
      }
    }

    .wechat-instruction {
      h4 {
        font-size: 16px;
      }

      p {
        font-size: 13px;
      }
    }
  }
}
</style>
